<!--
 * @FilePath     : /study_code/layui/10-29.html
 * @Description  : ready 组件成功弹出后的回调函数
 * @Date         : 2025-02-20 09:58
 * @Author       : Fang YingGui
 * @LastEditors  : fangyinggui 18715384437@163.com
 * @LastEditTime : 2025-04-09 10:57:13
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
    <link rel="stylesheet" href="/layui/dist/css/layui.css" />
  </head>
  <body>
    <button class="layui-btn" id="ID-dropdown-demo-content">
      自定义内容
      <i class="layui-icon layui-icon-list layui-font-14"></i>
    </button>

    <script src="/layui/dist/layui.js"></script>
    <!-- <script src="/dropdown/common.js"></script> -->
    <script>
      layui.use(function () {
        var dropdown = layui.dropdown

        // 自定义内容
        dropdown.render({
          elem: '#ID-dropdown-demo-content',
          content: '内容',
          style: 'border: 1px solid blue',

          /**
           * @brief: 组件成功弹出后的回调函数。
           * @param {*} elemPanal:组件面板元素对象
           * @param {*} elem:当前组件绑定的目标元素对象
           * @return {*}
           */
          ready: function (elemPanal, elem) {
            console.log(1, '组件面板元素对象', elemPanal)
            console.log(2, '当前组件绑定的目标元素对象', elem)
          },
        })
      })
    </script>
  </body>
</html>
